package vrp;

import com.google.appengine.api.datastore.Key;

import java.util.Date;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import vrp.SOrder;

@PersistenceCapable
public class SOrderItem {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;

    @Persistent
    private SOrder sorder;

    @Persistent
    private Key product;

    @Persistent
    private int quantity;

    @Persistent
    private Date deliveryDate;

    @Persistent
    private int sorderItemStatus;

    public SOrderItem(SOrder sorder, Key product, int quantity, Date deliveryDate) {
    	this.sorder = sorder;
    	this.product = product;
    	this.quantity = quantity;
    	this.deliveryDate = deliveryDate;
    	this.sorderItemStatus = 0; //not processed
    }

    public Key getKey() {
        return this.key;
    }

    public SOrder getSOrder() {
        return this.sorder;
    }

    public Key getProduct() {
        return this.product;
    }

    public int getQuantity() {
        return this.quantity;
    }

    public Date getDeliveryDate() {
        return this.deliveryDate;
    }
    
    public int getSOrderItemStatus() {
        return this.sorderItemStatus;
    }

    public void setKey(Key someKey) {
    	this.key = someKey;
    }

    public void setSOrder(SOrder sorder) {
        this.sorder = sorder;
    }

    public void setProduct(Key product) {
        this.product = product;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }
    
    public void setDeliveryDate(Date deliveryDate) {
        this.deliveryDate = deliveryDate;
    }    

    public void setSOrderItemStatus(int sorderItemStatus) {
        this.sorderItemStatus = sorderItemStatus;
    }
}